package com.eliza.ascl.conpv.provider

import android.content.Context
import android.database.sqlite.SQLiteDatabase
import android.database.sqlite.SQLiteOpenHelper


/*-*- coding:utf-8 -*-
 * @Author  : debi
 * @Time    : 5/9/22
 * @Software: Android Studio
 */
/*@Nullable Context context, @Nullable String name, @Nullable SQLiteDatabase.CursorFactory factory, int version*/
class UserDatabaseHelper(
    val context: Context,
    val dbName: String,
    val factory: SQLiteDatabase.CursorFactory?,
    val version: Int,
) : SQLiteOpenHelper(context, dbName, factory, version) {
    override fun onCreate(db: SQLiteDatabase) {
        val sql = "CREATE TABLE UserData(_id integer primary key autoincrement," +
                "username text not null," +
                "phonenumber text not null)"
        db.execSQL(sql)
    }

    override fun onUpgrade(p0: SQLiteDatabase?, p1: Int, p2: Int) {
        TODO("Not yet implemented")
    }
}